package com.charlotte.study.gupao.composite.tree;

import java.util.ArrayList;
import java.util.List;

/**
 * @author junjie.ding
 * @date 2020/3/10
 */
public class BranchNode extends Root {

    private List<Root> branchs;

    private Integer level;

    public BranchNode(String name, Integer level) {
        super(name);
        this.level = level;
        this.branchs = new ArrayList<>();
    }


    public void addNode(Root item){
        this.branchs.add(item);
    }

    public void removeNode(Root item){
        this.branchs.remove(item);
    }

    public Root get(int index){
        return  this.branchs.get(index);
    }

    @Override
    public void show() {

    }
}
